<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>酒店订单管理</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <!-- Bootstrap 3.3.7 -->
  <link rel="stylesheet" th:href="@{/bower_components/bootstrap/dist/css/bootstrap.min.css}">
  <!-- Font Awesome -->
  <link rel="stylesheet" th:href="@{/bower_components/font-awesome/css/font-awesome.min.css}">
  <!-- Ionicons -->
  <link rel="stylesheet" th:href="@{/bower_components/Ionicons/css/ionicons.min.css}">
  <!-- Theme style -->
  <link rel="stylesheet" th:href=" @{/dist/css/AdminLTE.min.css}">
  <!-- AdminLTE Skins. Choose a skin from the css/skins
       folder instead of downloading all of them to reduce the load. -->
  <link rel="stylesheet" th:href=" @{/dist/css/skins/_all-skins.min.css}">

</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">

  <div th:replace="/common/header :: header"></div>
  <!-- Left side column. contains the logo and sidebar -->
  <div th:replace="/common/aside :: aside"></div>

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        酒店订单管理
      </h1>
    </section>

    <!-- Main content -->
    <section class="content">
      <div class="row">

        <!-- right column -->
        <div class="col-md-12">
          <!-- Horizontal Form -->
          <div class="box box-info">
            <div class="box-header with-border">
              <h3 class="box-title">编辑信息</h3>
            </div>
            <!-- /.box-header -->
            <!-- form start -->
            <form class="form-horizontal" th:action="@{/order/editOrder}">
              <div class="box-body">
                <div class="form-group">
                  <label for="inputHoteName" class="col-sm-2 control-label">酒店名称</label>
                  <div class="col-sm-10">
                    <input type="text"  class="form-control" disabled="disabled" id="inputHoteName" placeholder="酒店名称" th:value="${order.hotelName}">
                    <input type="hidden" th:value="${order.orderId}" name="orderId">
                  </div>
                </div>
                <div class="form-group">
                <label for="inputOrderUser" class="col-sm-2 control-label">预定用户</label>
                <div class="col-sm-10">
                  <input type="text" class="form-control" id="inputOrderUser" disabled="disabled" placeholder="用户" th:value="${order.userName}">
                </div>
              </div>
                <div class="form-group">
                  <label for="inputOrderStatus" class="col-sm-2 control-label">订单状态</label>

                  <div class="col-sm-10">
                    <input hidden="hidden" id="hiddenStatus" th:value="${order.orderStatus}">
                    <select type="text" class="form-control" id="inputOrderStatus" placeholder="订单状态（0，已预定；1，已完成）" name="orderStatus" >
                      <option>已预定</option>
                      <option>已完成</option>
                    </select>
                  </div>
                </div>
                <div class="form-group">
                  <label for="inputIntime" class="col-sm-2 control-label">入住时间</label>
                  <div class="col-sm-10">
                    <input type="text" disabled="disabled"  class="form-control" id="inputIntime" placeholder="入住时间" name="orderInTime" th:value="${#dates.format(order.orderInTime,'yyyy-MM-dd HH:mm:ss')}">
                  </div>
                </div>
                <div class="form-group">
                  <label for="inputOrdertime" class="col-sm-2 control-label">入住时间</label>
                  <div class="col-sm-10">
                    <input type="text" disabled="disabled"  class="form-control" id="inputOrdertime" placeholder="预定时间" name="orderTime" th:value="${#dates.format(order.orderTime,'yyyy-MM-dd HH:mm:ss')}">
                  </div>
                </div>
              </div>
              <!-- /.box-body -->
              <div class="box-footer">
                <button type="button" id="cancel" class="btn btn-default">取消</button>
                <button type="submit" id="submit" class="btn btn-info pull-right">确定</button>
              </div>
              <!-- /.box-footer -->
            </form>
          </div>
          <!-- /.box -->
         
        </div>
        <!--/.col (right) -->
      </div>
      <!-- /.row -->
    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->
  <div th:replace="/common/footer :: footer"></div>
</div>
<!-- ./wrapper -->

<!-- jQuery 3 -->
<script th:src="@{/bower_components/jquery/dist/jquery.min.js}"></script>
<!-- Bootstrap 3.3.7 -->
<script th:src="@{/bower_components/bootstrap/dist/js/bootstrap.min.js}"></script>
<!-- FastClick -->
<script th:src="@{/bower_components/fastclick/lib/fastclick.js}"></script>
<!-- AdminLTE App -->
<script th:src="@{/dist/js/adminlte.min.js}"></script>
<!-- AdminLTE for demo purposes -->
<script>
 $(function () {
     $('#cancel').click(function () {
         alert("更新失败");
         history.go(-1);
         window.location.href=document.referrer;
     })
     var list = new Array();
     list =$('#inputOrderStatus option');
     for(var i=0; i< list.length;i++){
         if(list[i].text=$('#hiddenStatus').val()){list[i].attr('selected','selected');}
     }

 })

</script>
</body>
</html>
